$(function(){
	//客服列表
	MuiAjaxFn("client/salesman/select?page=1&pagesize=10", {}, function(data){
		var str = '';
		if(data.pageInfo.size != 0){
			//	渲染客服
		
			$.each( data.pageInfo.list,function(idx,obj){
				
				if(obj.headPhoto.indexOf("http://") == -1 ){
			        //判断当前的头像是否是有htto前缀.
			        obj.headPhoto = IMGUrl + '' + obj.headPhoto ;
			    }
				str += '<div class="BR_representative"  data-id="'+obj.id+'"> '+
					'<div class="BR_pic"><div style="background:url('+obj.headPhoto+')"></div></div>'+
					'<div class="BR_information BusinessRepresentative2Href">'+
					'	<div class="BR_font">'+obj.salesmanName+'</div>'+
					'	<div class="BR_font2"><span>'+obj.region+'</span><span></span></div>'+
					'</div>'+
					'<div class="BR_Consultation" >'+
					'	<button data-id="'+obj.id+'">点击咨询</button>'+
					'</div>'+
				'</div>';
			})
			
			$(".BR_list").html(str);
			$(".BR_Consultation button" ).on("tap",function(){
				window.location.href= "HelpCenter.html?source=customer&id="+$(this).attr("data-id");
			})
			$(".BR_pic , .BR_information").on("tap",function(){
				window.location.href= "BusinessRepresentative2.html?id="+$(this).parent().attr("data-id");
			})
		}else{
			//客服为空
			nodata("客服正在赶来路上!", ".BR_list",0);
		}
	})
	
	
})
